package com.xauto.pioneer.appuser.adapter;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;

import com.xauto.pioneer.appuser.R;
import com.xauto.pioneer.appuser.model.OrderTotalInfo;

/**订单费用详情适配器
 * Created by Lemon on 2015/12/11.
 * Desc:订单列表 适配器
 */
public class OrderTotalAdapter extends AbsAdapter<OrderTotalInfo> {

    public OrderTotalAdapter(Activity context, int layout) {
        super(context, layout);
    }

    @Override
    public ViewHolder<OrderTotalInfo> getHolder() {
        return new TemplateViewHolder();
    }


    private class TemplateViewHolder implements ViewHolder<OrderTotalInfo> {

        private TextView tv_ordertotal_name;
        private TextView tv_ordertotal_price;
        private TextView tvOrderDate;
        private TextView tvOrderExtend;
        private TextView tvOrderAccount;

        @Override
        public void initViews(View v, int position) {
            tv_ordertotal_name = (TextView) v.findViewById(R.id.tv_ordertotal_name);
            tv_ordertotal_price = (TextView) v.findViewById(R.id.tv_ordertotal_price);
//            tvOrderDate = (TextView) v.findViewById(R.id.tvOrderDate);
//            tvOrderExtend = (TextView) v.findViewById(R.id.tvOrderExtend);
//            tvOrderAccount = (TextView) v.findViewById(R.id.tvOrderAccount);
        }

        @Override
        public void updateData(OrderTotalInfo orderTotalInfo, int position) {
            tv_ordertotal_name.setText(orderTotalInfo.order_total_name);
            tv_ordertotal_price.setText(orderTotalInfo.order_total_amount_format);
//            tvOrderAccount.setText(context.getString(R.string.order_account,orderInfo.total_amount_format));
////            tvOrderStatus.setText(orderInfo.car_order_status_name);
//            tvOrderStatus.setText(orderTotalInfo.car_order_status_display_name );
//            tvOrderExtend.setVisibility("1".equals(orderTotalInfo.is_extend_info) ? View.VISIBLE : View.GONE);
        }

        @Override
        public void doOthers(OrderTotalInfo orderInfo, int position) {

        }
    }
}
